package com.study.bean;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;

@Data
@Component
public class UserDao {

    @Autowired
    DataSource dataSource;

    public void addUser() {
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.execute("INSERT INTO t_user VALUES('1','张三','20')");
    }

}
